﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Obstacle : MonoBehaviour
{
    public int HP = 2;
    public Sprite DamageSprite; // 敲碎的图片
    // Start is called before the first frame update
    public void attacked() {
        HP--;
        GetComponent<SpriteRenderer>().sprite = DamageSprite;
        if (HP <= 0) {
            Destroy(gameObject);
        }
    }
}
